home *** CD-ROM | disk | FTP | other *** search
/ Gekkan Dennou Club 147 / Gekkan Dennou Club - 2000.8 Vol. 147 (Japan).7z / Gekkan Dennou Club - 2000.8 Vol. 147 (Japan) (Track 1).bin / games / hitton / htn_src.lzh / HTN_SRC / HTN_GAME.C < prev    next >
Text File  |  2000-07-03  |  16KB  |  610 lines

  1. /*    『ひっとん』 ver.1.00    ゲーム (HTN_GAME.C)        2000  TAU Software    */
  2.  
  3. # include    "HTN_DEF.H"
  4.  
  5.  
  6. /***  1-line HITTON 用マクロ  ***/
  7.  
  8. # define    DEL_NUM 3    /*  消滅する最低ブロック数(2以上)  */
  9.  
  10. # define    MAX_TOP 16    /*  最大ブロック積数  */
  11.  
  12. # define    MAX_LV 99    /*  最高レベル  */
  13. # define    MAX_SCR 999999    /*  最大点数  */
  14. # define    MAX_BLK 9999    /*  最大ブロック数  */
  15.  
  16.  
  17. # define    RET_WAIT 1450        /*  キー押されなかった時のタイトル帰還時間  */
  18. # define    BLK_DEL_WAIT 3        /*  ブロック消滅ウェイト  */
  19. # define    OVER_WAIT 600        /*  ゲームオーバー時ウェイト  */
  20. # define    OVER_DEL_WAIT 20    /*  ゲームオーバー時ブロック削除ウェイト  */
  21. # define    NEXT_BLK_WAIT 60    /*  次ブロック出現ウェイト  */
  22. # define    NEXT_REN_WAIT 20    /*  次連鎖ウェイト  */
  23. # define    NAME_WAIT 100        /*  名前入力完了後ウェイト  */
  24.  
  25.  
  26. # define    FIXED_BLOCK(pl,xp) SET_SP_BLOCK((pl)*32+(xp)*2+2,248-(xp)*16,pl*122+92,*(m0+(xp)),*(mc+(xp)))
  27.             /*  ブロック描画(固定) <sprite>    pl:プレイヤー番号  xp:位置番号  */
  28.  
  29. # define    PRINT_LEVEL(pl,lv) PRINT_SPNUM( 98+(pl)*2, 78,18+(pl)*122,(lv),1,2,12+(pl)*2)
  30. # define    PRINT_SCORE(pl,sc) PRINT_SPNUM(102+(pl)*6,187,18+(pl)*122,(sc),1,6,13-(pl)*5)
  31. # define    PRINT_BLKNUM(pl,bkn) PRINT_SPNUM(114+(pl)*4,205,42+(pl)*122,(bkn),1,4,13-(pl)*5)
  32.                         /*  レベル・スコア・ブロック数 の表示  */
  33.  
  34.  
  35.  
  36. int HTN_GAME0()
  37. {
  38.  
  39.     int    i,j,k,z,ck0;        /*  雑用  */
  40.  
  41.     int    jd,jd2,rt=0;        /*  ジョイ入力データ、返り値用  */
  42.  
  43.     int    ret_tm,ret_ck=0;    /*  タイトル自動帰還管理用  */
  44.     int    inp_turn=0;        /*  名前入力排他用  */
  45.  
  46.     int    turn;    /*  プレイヤー番号  */
  47.  
  48.     RECS    *rec0;        /*  順位並び変え用記録データポインタ  */
  49.  
  50.  
  51. int    sc[2],bkn[2],lv[2];    /*  スコア、ブロック数、レベル  */
  52. int    spd[2],hspd[2],sdct[2];    /*  落下スピード、高速落下スピード、スピードアップ用  */
  53. int    tp[2],blk[2],n_blk[2];    /*  一番左のブロック位置、落下ブロック種類、次ブロック種類  */
  54. int    lkn[2],nlf[2],nrg[2];    /*  消滅ブロック数、消滅ブロック左位置、消滅ブロック右位置  */
  55. int    x0[2],nx[2],zz[2];    /*  落下ブロック位置、ブロックを置いた位置、雑用  */
  56. int    ct[2],rct[2],lct[2];    /*  カウント用、連鎖回数、レベルアップ用カウンタ  */
  57. int    map[2][18],*m0;        /*  仮想マップ(ブロック種類) */
  58. int    mapc[2][18],*mc;    /*  仮想マップ(連結パターン) */
  59. int    tm[2];            /*  ウェイト用時間保存  */
  60. int    rn[2],blkd[2];        /*  ランキング(順位)、出現ブロック種類数  */
  61. int    nmp[2];            /*  名前入力用(何文字目)  */
  62. char    name[2][5]={"アアアア","アアアア"},n2[2]=" ";    /*  名前入力用  */
  63.  
  64.  
  65. int    vdsp,pvdsp,vdsp_ck;    /*  垂直帰線期間チェック用  */
  66. int    stat[2];        /*  ステータス  */
  67.  
  68.  
  69.  
  70.     SCROLL2(0,0,0); SCROLL2(1,0,0);
  71.  
  72.  
  73.  
  74.     PRINT_LEVEL(0,1);
  75.     PRINT_SCORE(0,0);
  76.     PRINT_BLKNUM(0,0);
  77.     PRINT_LEVEL(1,1);
  78.     PRINT_SCORE(1,0);
  79.     PRINT_BLKNUM(1,0);
  80.  
  81.  
  82.     VDISP0();
  83.     VPAGE2(0x6F);
  84.     SP_ON();
  85.  
  86.  
  87.  
  88.     (**map)=(*(*map+17))=-1;
  89.     (**(map+1))=(*(*(map+1)+17))=-1;
  90.  
  91.  
  92.     turn=1;
  93.  
  94.     *stat=*(stat+1)=-99;
  95.     vdsp=(B_BPEEK((unsigned char *)0xE88001) & 0x10);
  96.  
  97.  
  98.     jd=JOY0(turn);
  99.     ret_tm=ONTIME();
  100.     while(1){
  101.  
  102.         turn=1-turn;
  103.         jd=JOY0(turn);
  104.         
  105.         if(jd & 0x4000){
  106.             PLAY_MUS(4);
  107.             *tm=D_TIME(*tm); *(tm+1)=D_TIME(*(tm+1));
  108.             ret_tm=D_TIME(ret_tm);
  109.             VDISP0();
  110.             VPAGE2(0x2F);
  111.             B_WPOKE((unsigned short *)0xE80014,256); /*  テキストスクロールX  */
  112.             jd|=PAUSE();
  113.             B_WPOKE((unsigned short *)0xE80014,0);    /*  テキストスクロールX  */
  114.             VDISP0();
  115.             VPAGE2(0x6F);
  116.             PLAY_MUS(3);
  117.             *tm=D_TIME(*tm); *(tm+1)=D_TIME(*(tm+1));
  118.             ret_tm=D_TIME(ret_tm);
  119.         }
  120.         if(jd & 0x8000){ rt=-1; break; }
  121.         if(jd & 0x2000){ rt=1; break; }        /* タイトル帰還  DEBUG用  */
  122.  
  123.         if(*stat==-97 && *(stat+1)==-97){
  124.             if(ret_ck == 0) ret_tm=ONTIME();
  125.             if(D_TIME(ret_tm) > RET_WAIT){ rt=1; break; }
  126.             ret_ck=1;
  127.         } else ret_ck=0;
  128.  
  129.         m0=*(map+turn);
  130.         mc=*(mapc+turn);
  131.         if(turn == 0){
  132.             pvdsp=vdsp;
  133.             vdsp=(B_BPEEK((unsigned char *)0xE88001)&0x10);
  134.             vdsp_ck=(pvdsp&~vdsp);
  135.         }
  136.  
  137.         switch(*(stat+turn)){
  138.             case 0:        /*  */
  139.                 *(x0+turn)+=*(spd+turn);
  140.                 ck0=0;
  141.                 if(jd&8 && *(hspd+turn)>*(spd+turn)){
  142.                     *(x0+turn)+=*(hspd+turn);
  143.                     ck0=1;
  144.                 }
  145.                 if(*(x0+turn) > 232){    /*  落下ブロック右端まで来た時  */
  146.                     *(nx+turn)=1;
  147.                     *(stat+turn)=52;
  148.                     break;
  149.                 }
  150.                 if(((248-*(x0+turn))/16) < *(nx+turn)){  /*  落下ブロック、ブロック境に来た時  */
  151.                     (*(nx+turn))--;
  152.                     if(*(nx+turn) < *(tp+turn)){  /*  ?落下ブロック、積みブロックに到達した時  */
  153.                         if(!(jd&32)){
  154.                             (*(nx+turn))++;
  155.                             *(stat+turn)=52;
  156.                             break;
  157.                         }
  158.  
  159.                         if(*(sc+turn)<MAX_SCR && ck0!=0){
  160.                             (*(sc+turn))++;
  161.                             (*(lct+turn))++;
  162.                             PRINT_SCORE(turn,*(sc+turn));    /*  点数表示  */
  163.                         }
  164.  
  165.                         if(*(m0+*(nx+turn)+2) == *(m0+*(nx+turn))){
  166.                             *(mc+*(nx+turn))=2;
  167.                             *(mc+*(nx+turn)+2)=(*(mc+*(nx+turn)+2)/2)*2+1;
  168.                             FIXED_BLOCK(turn,*(nx+turn)+2);
  169.                         } else *(mc+*(nx+turn))=0;
  170.                         if(*(m0+*(nx+turn)-1) != -1){
  171.                             *(mc+*(nx+turn)-1)=*(mc+*(nx+turn)-1)%2;
  172.                             FIXED_BLOCK(turn,*(nx+turn)-1);
  173.                         }
  174.  
  175.                     }
  176.  
  177.                     if(*(nx+turn) <= *(tp+turn)){
  178.  
  179.                         *(m0+*(nx+turn)+1)=*(m0+*(nx+turn));
  180.                         *(mc+*(nx+turn)+1)=*(mc+*(nx+turn));
  181.                         *(m0+*(nx+turn))=*(blk+turn);
  182.                         *(mc+*(nx+turn))=0;
  183.                     }
  184.  
  185.                     if(*(nx+turn) < *(tp+turn)){
  186.                         FIXED_BLOCK(turn,*(nx+turn)+1);
  187.                         SP_REGST0(turn*32+*(nx+turn)*2+2,0,0,0);
  188.                         SP_REGST0(turn*32+*(nx+turn)*2+3,0,0,0);
  189.                     }
  190.  
  191.                 }
  192.                 *(stat+turn)=50;
  193.                 break;
  194.  
  195.             case 2:    /*  消滅判定  */
  196.                 ck0=0;
  197.                 if(*(m0+*(nlf+turn)+1) == *(blk+turn)) (*(nlf+turn))++; else ck0++;
  198.                 if(*(m0+*(nrg+turn)-1) == *(blk+turn)) (*(nrg+turn))--; else ck0++;
  199.                 if(ck0 == 2){
  200.                     *(lkn+turn)=*(nlf+turn)-*(nrg+turn);
  201.                     if(*(lkn+turn) > DEL_NUM-2+(*(blk+turn)==5)){
  202.                         *(ct+turn)=0;
  203.                         PLAY_MUS(6);
  204.                         *(tm+turn)=ONTIME();
  205.                         *(stat+turn)=53;
  206.                     } else{
  207.                          PLAY_MUS(7);
  208.                         *(tm+turn)=ONTIME();
  209.                         *(stat+turn)=-1;
  210.                     }
  211.                 }
  212.                 break;
  213.  
  214.             case 3:    /*  ブロック消滅よる落下準備  */
  215.                 if(*(nlf+turn) == *(tp+turn)-1){
  216.                     *(tp+turn)-=(*(lkn+turn)+1);
  217.                     *(m0+*(tp+turn))=-1;
  218.                     *(tm+turn)=ONTIME();
  219.                     *(stat+turn)=-1;
  220.                     break;
  221.                 }
  222.                 *(ct+turn)=1;
  223.                 *(stat+turn)=4;
  224.                 break;
  225.  
  226.             case 4:
  227.                 if(*(ct+turn) < 17){
  228.                     if(*(ct+turn)==1 && vdsp_ck!=0) break;
  229.                     i=*(ct+turn);
  230.                     if(i<*(tp+turn) && i>*(nlf+turn)){
  231.                         SET_BG_BLOCK(turn,i,*(m0+i),*(mc+i));
  232.                     } else SET_BG_BLOCK(turn,i,-1,0);
  233.                     (*(ct+turn))++;
  234.                     break;
  235.                 }
  236.  
  237.                 VDISP0();
  238.                     BGSCRLST(0x80000000+turn,256,164-turn*122);
  239.                 BGCTRLST(turn,-1,1);
  240.                 for(i=*(nlf+turn)+1;i<*(tp+turn);i++){
  241.                     SP_REGST0(turn*32+i*2+2,0,0,0);
  242.                     SP_REGST0(turn*32+i*2+3,0,0,0);
  243.                 }
  244.  
  245.                 *(ct+turn)=*(lkn+turn)*4+4;
  246.                 *(zz+turn)=256;
  247.  
  248.                 *(tm+turn)=ONTIME();
  249.                 *(stat+turn)=55;
  250.                 break;
  251.  
  252.  
  253.             case 50:    /*  落下ブロック移動  */
  254.                 if(vdsp_ck){
  255.                     SET_SP_BLOCK(turn*2,*(x0+turn),turn*122+92,*(blk+turn),0);
  256.                     *(stat+turn)=0;
  257.                 }
  258.                 break;
  259.  
  260.             case 52: if(vdsp_ck){    
  261.  
  262.                     SP_REGST0(turn*2,0,0,0);    /* 落下ブロック消去  */
  263.                     SP_REGST0(turn*2+1,0,0,0);
  264.                     
  265.                     *(m0+*(nx+turn))=*(blk+turn);
  266.                     *(mc+*(nx+turn))=0;
  267.  
  268.  
  269.                     if(*(m0+*(nx+turn)+1) == *(blk+turn)){
  270.                         *(mc+*(nx+turn))=*(mc+*(nx+turn))+2;
  271.                         *(mc+*(nx+turn)+1)=(*(mc+*(nx+turn)+1)/2)*2+1;
  272.                         FIXED_BLOCK(turn,*(nx+turn)+1);
  273.                     }
  274.                     if(*(m0+*(nx+turn)-1) == *(blk+turn)){
  275.                         *(mc+*(nx+turn))=*(mc+*(nx+turn))+1;
  276.                         *(mc+*(nx+turn)-1)=*(mc+*(nx+turn)-1)%2+2;
  277.                         FIXED_BLOCK(turn,*(nx+turn)-1);
  278.                     }
  279.                     FIXED_BLOCK(turn,*(nx+turn));
  280.  
  281.                     *(rct+turn)=0;
  282.  
  283.                     (*(tp+turn))++;
  284.                     *(nlf+turn)=*(nx+turn);
  285.                     *(nrg+turn)=*(nx+turn);
  286.  
  287.                     *(stat+turn)=2;
  288.                  }
  289.                  break;
  290.  
  291.  
  292.             case 53: /*  消滅アニメーション  */
  293.                 if(D_TIME(*(tm+turn)) <= (*(ct+turn))*BLK_DEL_WAIT) break;
  294.                 if(vdsp_ck){
  295.                     if(*(ct+turn) < 6){
  296.                         for(i=*(nrg+turn);i<=*(nlf+turn);i++){
  297.                             SP_REGST0(turn*32+i*2+2,248-i*16,turn*122+96,*(blk+turn)*256+305+*(ct+turn));
  298.                             if(*(ct+turn) == 0){
  299.                                 SP_REGST0(turn*32+i*2+2,0,0,0);
  300.                                 SP_REGST0(turn*32+i*2+3,0,0,0);
  301.                             }
  302.                         }
  303.                         (*(ct+turn))++;
  304.                      } else{
  305.                         for(i=*(nrg+turn);i<=*(nlf+turn);i++) SP_REGST0(turn*32+i*2+2,0,0,0);
  306.  
  307.                         (*(rct+turn))++;
  308.                         k=*(rct+turn);
  309.                         z=*(lkn+turn)+1;
  310.                         j=(k*k*k*k)*(z*(z-1));
  311.                         *(sc+turn)+=(((k*k*2)+(*(lv+turn)/4-1))*(z-2)*(z*10));
  312.                         *(bkn+turn)+=z;
  313.  
  314.  
  315.                         if(*(sc+turn) > MAX_SCR) *(sc+turn)=MAX_SCR;
  316.                         if(*(bkn+turn) > MAX_BLK) *(bkn+turn)=MAX_BLK;
  317.                         if(*(lv+turn) < MAX_LV){
  318.                             *(lct+turn)+=((j/10)+100);
  319.                             if(*(lct+turn)>999){
  320.                                 (*(lv+turn))++;
  321.                                 PLAY_MUS(5);
  322.                                 PRINT_LEVEL(turn,*(lv+turn));    /*  レベル表示  */
  323.                                 *(lct+turn)=0;
  324.                                 *(spd+turn)=(int)(sqrt(*(lv+turn))+1.5);
  325.                                 if(*(spd+turn)>8) *(spd+turn)=8; else if(*(spd+turn)<2) *(spd+turn)=2;
  326.                                 *(hspd+turn)=*(spd+turn)+4;
  327.                                 *(sdct+turn)=1000/(int)(*(lv+turn)/20+2);
  328.                                 *(blkd+turn)=4+(*(lv+turn)>1)+(*(lv+turn)>18)-(*(lv+turn)>36 && ((*(lv+turn))&1)==0 );
  329.                             } else{
  330.                                 if(*(lct+turn) >= *(sdct+turn)){
  331.                                     (*(sdct+turn))+=(1000/(int)(*(lv+turn)/20+2));
  332.                                     (*(spd+turn))++;
  333.                                     if(*(hspd+turn) < 16) (*(hspd+turn))++;
  334.                                 }
  335.                             }
  336.                         }
  337.                         PRINT_SCORE(turn,*(sc+turn));    /*  点数表示  */
  338.                         PRINT_BLKNUM(turn,*(bkn+turn));    /*  累積消滅ブロック数表示  */
  339.  
  340.                         *(ct+turn)=*(nlf+turn)+1;
  341.                         *(stat+turn)=3;
  342.                     }
  343.                 }
  344.                 break;
  345.  
  346.             case 55: /*  ブロック消滅による落下  */
  347.                  if(vdsp_ck){
  348.                      BGSCRLST(0x80000000+turn,*(zz+turn),164-turn*122);
  349.                      if(*(ct+turn) > 0){
  350.                          (*(ct+turn))--;
  351.                          *(zz+turn)-=4;
  352.                      } else{
  353.                         *(ct+turn)=0;
  354.                         *(tm+turn)=ONTIME();
  355.                         *(stat+turn)=56;
  356.                     }
  357.                  }
  358.                  break;
  359.  
  360.             case 56:/*  ブロック再描画  */
  361.                  if(vdsp_ck){
  362.                     if(*(ct+turn) < *(tp+turn)-*(nlf+turn)-1){
  363.                         z=*(nrg+turn)+*(ct+turn);
  364.                         *(m0+z)=*(m0+*(ct+turn)+*(nlf+turn)+1);
  365.                         *(mc+z)=*(mc+*(ct+turn)+*(nlf+turn)+1);
  366.  
  367.                         if(*(m0+z-1) == *(m0+z)){
  368.                             *(mc+z)=(*(mc+z)/2)*2+1;
  369.                             *(mc+z-1)=*(mc+z-1)%2+2;
  370.                             FIXED_BLOCK(turn,z-1);
  371.                         }
  372.                         FIXED_BLOCK(turn,z);
  373.                         (*(ct+turn))++;
  374.                     } else{
  375.                         *(tp+turn)-=(*(lkn+turn)+1);
  376.                         *(m0+*(tp+turn))=-1;
  377.                         BGCTRLST(turn,-1,0);
  378.                         if(*(m0+*(nrg+turn)-1) == *(m0+*(nrg+turn))
  379.                                     && *(m0+*(nrg+turn))!=-1)
  380.                                         *(stat+turn)=58; else{ *(tm+turn)=ONTIME(); *(stat+turn)=-1; }
  381.                     }
  382.                  }
  383.                  break;
  384.  
  385.             case 58: /*  連鎖判定準備  */
  386.                  if(D_TIME(*(tm+turn)) > NEXT_REN_WAIT){
  387.                     *(nlf+turn)=*(nrg+turn);
  388.                     *(blk+turn)=*(m0+*(nrg+turn));
  389.                     *(stat+turn)=2;
  390.                  }
  391.                  break;
  392.  
  393.  
  394.             case -1:    /*  次ブロック出現待  */
  395.                  if(*(tp+turn) > MAX_TOP){ *(stat+turn)=-19; break; }
  396.                  if(D_TIME(*(tm+turn)) > NEXT_BLK_WAIT){
  397.                     *(x0+turn)=-17;
  398.                     *(nx+turn)=17;
  399.                     *(blk+turn)=*(n_blk+turn);
  400.                     z=*(blkd+turn);
  401.                     if(z==6 && *(tp+turn)>12) z=5;
  402.                     *(n_blk+turn)=RND0()*z;
  403.                     SET_SP_BLOCK(turn*2+122,205,turn*122+64,*(n_blk+turn),0);
  404.                     *(stat+turn)=0;
  405.                  }
  406.                  break;
  407.  
  408.             case -17: if(vdsp_ck==0) break;
  409.                   if(jd&32){    /*  ゲームオーバークリア  */
  410.                     VDISP0();
  411.                           TXFILL0(38,turn*122+94,180,18,15,0);
  412.                     *(stat+turn)=-99;
  413.                   }
  414.                   break;
  415.  
  416.             case -19:    /*  ゲームオーバー  */
  417.                 if(vdsp_ck==0) break;
  418.                 PRINT_MES(38,turn*122+94,"ゲーム オーバー",5-turn*4);
  419.                 PLAY_MUS(10);
  420.                 *(ct+turn)=1;
  421.                 *(tm+turn)=ONTIME();
  422.                 *(stat+turn)=-20;
  423.                 break;
  424.  
  425.             case -20:    /*  ゲームオーバー:ブロックの消滅  */
  426.                 if(D_TIME(*(tm+turn)) <= OVER_DEL_WAIT+(*(ct+turn))*BLK_DEL_WAIT) break;
  427.                 if(vdsp_ck==0) break;
  428.                 if(jd&32){
  429.                     for(i=0;i<32;i++) SP_REGST0(turn*32+i+4,0,0,0);
  430.                     *(ct+turn)=MAX_TOP+7;
  431.                     *(tm+turn)=ONTIME()-OVER_WAIT;
  432.                 }
  433.                 if(*(ct+turn) > MAX_TOP+7){
  434.                     if(D_TIME(*(tm+turn)) > OVER_WAIT){
  435.                               TXFILL0(38,turn*122+94,180,18,15,0);
  436.                               *(stat+turn)=-21;
  437.                     }
  438.                     break;
  439.                 }
  440.                 
  441.                 if(*(ct+turn) <= MAX_TOP)
  442.                     SP_REGST0(turn*32+*(ct+turn)*2+3,0,0,0);
  443.                 for(i=0;i>=-6;i--){
  444.                     z=*(ct+turn)+i;
  445.                     if(z>=1 && z<=MAX_TOP)
  446.                         if(i > -6)
  447.                             SP_REGST0(turn*32+z*2+2,248-z*16,turn*122+96,*(m0-i)*256+305-i);
  448.                         else SP_REGST0(turn*32+z*2+2,0,0,0);
  449.                 }
  450.                 (*(ct+turn))++;
  451.                 break;
  452.  
  453.             case -21:
  454.                 if(inp_turn != 0){
  455.                     if(inp_turn == 1) PRINT_MES(38,turn*122+94,"チョット マッテネ!",4);
  456.                     inp_turn=2;
  457.                     break;
  458.                 }
  459.  
  460.                 VDISP0();
  461.                 TXFILL0(38,turn*122+94,180,18,15,0);
  462.                 for(i=0;i<5;i++){
  463.                     rec0=RECS_DATA(i,NULL);
  464.                     if(*(sc+turn) > rec0->score) break;
  465.                 }
  466.                 *(rn+turn)=i;
  467.                 if(i < 5){
  468.                     PLAY_MUS(11);
  469.                     PRINT_MES(36,turn*122+94,"ベスト",2+turn);
  470.                     PRINT_TXNUM(110,turn*122+95,i+1,1,1,2+turn);
  471.                     PRINT_MES(124,turn*122+94,"!",2+turn);
  472.  
  473.                     *(nmp+turn)=0;
  474.                     PRINT_MES(148,turn*122+94,*(name+turn),5-turn*4);
  475.                     *n2=**(name+turn);
  476.                     PRINT_MES(148,turn*122+94,n2,turn+2);
  477.  
  478.                     inp_turn=1;
  479.                     JOYINP1(turn);
  480.                     *(nmp+turn)=0;
  481.                     *(stat+turn)=-22;
  482.                 } else *(stat+turn)=-99;
  483.  
  484.                 break;
  485.  
  486.  
  487.             case -22:    /*  ベストレコード入力  */
  488.                 /*if(vdsp_ck==0) break;*/
  489.                 if(*(nmp+turn) >= 4){
  490.                     PLAY_MUS(8);
  491.                     PRINT_MES(148,turn*122+94,*(name+turn),7-turn);
  492.                     for(i=4;i>*(rn+turn);i--)
  493.                         RECS_DATA(i,RECS_DATA(i-1,NULL));
  494.                     rec0=RECS_DATA(*(rn+turn),NULL);
  495.  
  496.                     strcpy(rec0->name,*(name+turn));
  497.                     (rec0->score)=*(sc+turn);
  498.                     (rec0->block)=*(bkn+turn);
  499.                     (rec0->level)=*(lv+turn);
  500.  
  501.                     WRITE_REC();
  502.  
  503.                           inp_turn=0;
  504.                     *(tm+turn)=ONTIME();
  505.                     *(stat+turn)=-23;
  506.                 } else{
  507.  
  508.                     if(jd & 0x1000){
  509.                               inp_turn=0;
  510.                             TXFILL0(2,turn*122+94,252,18,15,0);
  511.                         *(stat+turn)=-99;
  512.                         break;
  513.                     }
  514.  
  515.                     jd=JOYINP1(turn);
  516.  
  517.                     z=*(nmp+turn);
  518.                     i=0; ck0=-1;
  519.                     if(jd&15){
  520.                         ck0=INP_NAME(*(*(name+turn)+z),jd);
  521.                         if(ck0!=-1) *(*(name+turn)+z)=(char)ck0;
  522.                     } else{
  523.                         i=(((jd&32)!=0)-((jd&64)!=0));
  524.                         if(z+i<0) i=0;
  525.                         if(i){
  526.                             PLAY_MUS(9);
  527.                             *n2=*(*(name+turn)+z);
  528.                             PRINT_MES(z*18+148,turn*122+94,n2,5-turn*4);
  529.                             z+=i;
  530.                             *(nmp+turn)=z;
  531.                         }
  532.                     }
  533.  
  534.                     if((i!=0 || ck0!=-1) && z<4){
  535.                         *n2=*(*(name+turn)+z);
  536.                         PRINT_MES(z*18+148,turn*122+94,n2,turn+2);
  537.                     }
  538.  
  539.                 }
  540.                 break;
  541.  
  542.             case -23:    /*  名前入力後ウェイト  */
  543.                 if(D_TIME(*(tm+turn)) <= NAME_WAIT) break;
  544.                 if(vdsp_ck==0) break;
  545.                     TXFILL0(2,turn*122+94,252,18,15,0);
  546.                 *(stat+turn)=-99;
  547.                 break;
  548.  
  549.  
  550.  
  551.             case -97:    /*  ゲーム開始!  */
  552.                   if(jd&32){
  553.                     PLAY_MUS(8);
  554.                     if(vdsp_ck==0) break;
  555.                           TXFILL0(38,turn*122+94,180,18,15,0);
  556.                     *(tm+turn)=ONTIME();
  557.                     *(stat+turn)=-1;
  558.                   }
  559.                   break;
  560.  
  561.             case -98:    /*  新規ゲーム開始待ち  */
  562.                       if(!(jd&32)) (*(stat+turn))++;
  563.                   break;
  564.  
  565.             case -99:    /*  新規ゲームパラメータ設定 */
  566.                 if(vdsp_ck==0) break;
  567.                 PRINT_MES(38,turn*122+94,"ボタンヲオシテネ!",7-turn);
  568.                 for(i=0;i<32;i++) SP_REGST0(turn*32+i+4,0,0,0);
  569.                 PRINT_LEVEL(turn,1);
  570.                 PRINT_SCORE(turn,0);
  571.                 PRINT_BLKNUM(turn,0);
  572.  
  573.  
  574.                 *(lv+turn)=1;
  575.                 *(sc+turn)=0;
  576.                 *(bkn+turn)=0;
  577.                 *(lct+turn)=0;
  578.                 *(n_blk+turn)=RND0()*4;
  579.                 *(spd+turn)=2;
  580.                 *(hspd+turn)=6;
  581.                 *(sdct+turn)=500;
  582.                 *(blkd+turn)=4;
  583.  
  584.                 VDISP0();
  585.                 SET_SP_BLOCK(turn*2+122,205,turn*122+64,*(n_blk+turn),0);
  586.  
  587.  
  588.                 *(tp+turn)=1;
  589.                 *(m0+*(tp+turn))=-1;
  590.  
  591.                     *(stat+turn)=-98;
  592.                 break;
  593.         }
  594.     }
  595.  
  596.  
  597.  
  598.     VDISP0();
  599.     VPAGE2(0);
  600.     APAGE(0);
  601.     SP_OFF();
  602.     TXFILL0(0,0,256,256,15,0);
  603.     for(i=0;i<128;i++) SP_REGST0(i,0,0,0);
  604.  
  605.     return rt;
  606.  
  607. }
  608.  
  609.  
  610.